//
//  KZWithdrawRecordCell.swift
//  BoyeStore
//
//  Created by 朱凯 on 2018/6/28.
//  Copyright © 2018年 itboye. All rights reserved.
//

import UIKit

class KZWithdrawRecordCell: UITableViewCell {
    
    let timeLabel = UILabel()
    let moneyLabel = UILabel()
    let toLabel = UILabel()
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        self.backgroundColor = .clear
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

extension KZWithdrawRecordCell {
    
    func setupUI() {
        
    
        timeLabel.textColor = UIColor.gray
        timeLabel.textAlignment = .right
        timeLabel.text = "2018/06/21 18:02"
        timeLabel.font = UIFont.systemFont(ofSize: 12)
        contentView.addSubview(timeLabel)
        timeLabel.snp.makeConstraints { (m) in
            m.left.equalTo(10)
            m.top.equalTo(15)
        }
        
        toLabel.textColor = UIColor.gray
        toLabel.textAlignment = .left
        toLabel.text = "支付宝"
        toLabel.font = UIFont.systemFont(ofSize: 13)
        contentView.addSubview(toLabel)
        toLabel.snp.makeConstraints { (m) in
            m.left.equalTo(timeLabel)
            m.top.equalTo(timeLabel.snp.bottom).offset(10)
        }
        
        moneyLabel.numberOfLines = 1
        moneyLabel.textColor = UIColor.black
        moneyLabel.textAlignment = .left
        moneyLabel.text = "提现 ￥6666.0"
        moneyLabel.font = UIFont.systemFont(ofSize: 15)
        contentView.addSubview(moneyLabel)
        moneyLabel.snp.makeConstraints { (m) in
            m.right.equalTo(-10)
            m.centerY.equalTo(contentView)
        }
        moneyLabel.attributedText = moneyLabel.text?.attrubutesString(attrubutes: [NSAttributedStringKey.foregroundColor: kThemeColor, NSAttributedStringKey.font: kFont(18)], scope: "￥6666.0")
        
        
        let line = UIView()
        line.backgroundColor = kLineColor
        contentView.addSubview(line)
        line.snp.makeConstraints { (m) in
            m.top.equalTo(toLabel.snp.bottom).offset(15)
            m.left.equalTo(10)
            m.right.equalTo(-10)
            m.height.equalTo(0.5)
            
            m.bottom.equalTo(0)
        }
        
       
        
        
        
        
    }
}
